home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / HYPERCAR / BUTTONS_ / COOL_BUT.TON / card_4114.txt < prev    next >
Text File  |  1988-03-23  |  2KB  |  104 lines

  1. -- card: 4114 from stack: in.TON
  2. -- bmap block id: 2216
  3. -- flags: 0000
  4. -- background id: 3537
  5. -- name: 
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: A004
  11. -- rect: left=398 top=281 right=303 bottom=499
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 21
  16. -- text size: 10
  17. -- style flags: 0
  18. -- line height: 13
  19. -- part name: Spiral
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   ask "what tool?" with "brush tool"
  23.   choose it
  24.   set brush to random(32)
  25.   set polysides to random(8)
  26.  
  27.   domenu "select all"
  28.   domenu "clear picture"
  29.  
  30.   put 250 into xcenter
  31.   put 180 into ycenter
  32.   put 100 into radius
  33.   put 50 into numbsegs
  34.   put 0 into angle
  35.  
  36.   repeat until radius is 0
  37.     put xcenter + round (radius * sin (angle)) into x
  38.     put ycenter - round (radius * cos (angle)) into y
  39.     drag from xcenter,ycenter to x, y
  40.     add (2 * pi * 1 / numbsegs) to angle
  41.     subtract 1/2 from radius
  42.     subtract 1/2 from numbsegs
  43.   end repeat
  44.  
  45. end mouseUp
  46.  
  47.  
  48. -- part 3 (button)
  49. -- low flags: 00
  50. -- high flags: A004
  51. -- rect: left=396 top=306 right=329 bottom=497
  52. -- title width / last selected line: 0
  53. -- icon id / first selected line: 0 / 0
  54. -- text alignment: 1
  55. -- font id: 21
  56. -- text size: 10
  57. -- style flags: 0
  58. -- line height: 13
  59. -- part name: spiral shapes
  60. ----- HyperTalk script -----
  61. on mouseUp
  62.  
  63.   ask "Draw shape with what tool?" with "Regular polygon tool"
  64.   choose it
  65.   if it is "reg. polygon" then
  66.     choose regular polygon tool
  67.     set polysides to random(6) +2
  68.   end if
  69.  
  70.   ask "Radius? (in pixels)" with "100"
  71.   if it is "cancel" then exit mouseup
  72.   put it into Radius
  73.  
  74.   ask "Increments?" with "100"
  75.   if it is "cancel" then exit mouseup
  76.   put it into numbsegs
  77.  
  78.   ask "Rate?" with "2"
  79.   if it is "cancel" then exit mouseup
  80.   put it into rate
  81.  
  82.   domenu "select all"
  83.   domenu "clear picture"
  84.   --set centered to true
  85.   --set grid to false
  86.  
  87.   put 250 into xcenter
  88.   put 180 into ycenter
  89.   put 0 into angle
  90.  
  91.   repeat until radius is 0
  92.     put xcenter + round (radius * sin (angle)) into x
  93.     put ycenter - round (radius * cos (angle)) into y
  94.     drag from xcenter,ycenter to x, y
  95.     add (rate * pi * 1 / numbsegs) to angle
  96.     subtract 2 from radius
  97.   end repeat
  98.  
  99.   choose browse tool
  100.  
  101. end mouseUp
  102.  
  103.  
  104.